package implementation.menu {

import palf.menu.Menu;
import palf.menu.MenuAbstractFactory;
import palf.menuItems.MenuItem;

internal class MenuImplementation implements Menu {

	private var content : Vector.<MenuItem>;
	private var factory : MenuAbstractFactory;

	public function MenuImplementation(factory : MenuAbstractFactory) {
		content = Vector.<MenuItem>([]);
		this.factory = factory;
	}

	public function addItemAt(item : MenuItem) : void {
		content.push(item);
		factory.draw(item);
	}

	public function removeItemAt(index : uint) : void {

	}

	public function clearItems() : void {
		content = Vector.<MenuItem>([]);
		factory.clear();
	}

	public function sort() : void {
		factory.sort();
	}

}

}
